<template>
  <view class="detailMain">
    <view class="detailBox">
      <u-form :model="form" ref="uForm" label-width="150">
        <u-form-item label="姓名"><u-input v-model="form.name" /></u-form-item>
        <u-form-item label="联系电话"><u-input v-model="form.phone" /></u-form-item>
        <u-form-item label="工作单位"><u-input pleaceholder="请选择工作单位" v-model="form.keyword" type="select" /></u-form-item>
        <u-form-item label="培训班"><u-input pleaceholder="请选择培训班" v-model="form.keyword" type="select" /></u-form-item>
        <u-form-item label="培训时间"><u-input pleaceholder="请选择培训时间" v-model="form.keyword" type="select" /></u-form-item>
        <u-form-item label="请假时间"><u-input pleaceholder="请选择请假时间" v-model="form.keyword" type="select" /></u-form-item>
        <u-form-item label="请假天数"><u-input v-model="form.keyword" readonly/></u-form-item>
        <u-form-item label="请假事由"><u-input type="textarea" rows="5" v-model="form.keyword"/></u-form-item>
        <u-form-item label="请假人签字">
          <u-input v-model="form.student" disabled/>
          <u-button type="primary" size="mini" slot="right">查看签名</u-button>
        </u-form-item>
        <u-form-item label="班主任签字">
          <u-input v-model="form.teacher" pleaceholder="请打开签字板签字"/>
          <u-button type="primary" size="mini" slot="right">打开签字板</u-button>
        </u-form-item>
      </u-form>
      <!--提交申请-->
      <view class="btnBox">
        <u-button type="primary" @click="SignUp">提交申请</u-button>
        <view style="display: flex; align-items: center; justify-content: center; height: 80rpx;">
          <view>
            <u-icon name="order" style="margin-right: 10rpx; position: relative; top: -2rpx;"></u-icon>
            提交记录
          </view>
        </view>
      </view>
    </view>
    <u-back-top :scroll-top="scrollTop"></u-back-top>
    <u-top-tips ref="uTips"></u-top-tips>
    <toast></toast>
  </view>
</template>
<script>
export default {
  data() {
    return {
      scrollTop: 0,
      type: '',
      form: {
        name: '张三',
        phone: '13288888888',
        keyword: '',
        student: '已签',
        teacher: ''
      }
    }
  },
  onLoad(option) {
    this.type = option.type;
  },
  onShow() {},
  onPullDownRefresh() {},
  onShareAppMessage() {},
  methods: {
    /* 顶部提示文字 */
    uTips(title, type = 'warning', duration = 1500) {
      this.$refs.uTips.show({
        title: title,
        type: type,
        duration: duration,
      })
    },
    /* 返回顶部 */
    onPageScroll(e) {
      this.scrollTop = e.scrollTop
    },
    // 立即报名
    SignUp(){
      uni.switchTab({
        url: 'pages/mine/index'
      });
    }
  },
}
</script>
<style lang="scss" scoped>
page {
  background: #fff;
  padding-bottom: 120rpx;
}
.detailMain{
  padding: 0 40rpx;
}
.content{
  padding: 20rpx;
  >text{
    display: block;
    font-size: 28rpx;
    line-height: 44rpx;
  }
}
.navView{
  height: 20rpx;
  background: #f1f1f1;
}
.btnBox{
  padding: 20rpx 0;
}
</style>
